// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import store from './store'
import App from './App'
import router from './router'
import axios from 'axios'

import Cookies from 'js-cookie'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
import $request from '@/utils/open/request'
import $validate from '@/utils/open/validate'
import $constant from '@/utils/open/constant'
import $com from '@/utils/open/common'
import $eltool from '@/utils/open/eltool'
import './permission'

Vue.prototype.$axios = axios
Vue.prototype.$request = $request
Vue.prototype.$validate = $validate
Vue.prototype.$constant = $constant
Vue.prototype.$com = $com
Vue.prototype.$eltool = $eltool

if(process.env.NODE_ENV === 'development'){
  $constant.ctx = 'http://127.0.0.1:3000'
}else{
  $constant.ctx = 'http://127.0.0.1:3000'
}


Vue.use(Element, {
  size: Cookies.get('size') || 'medium', // set element-ui default size
  i18n: (key, value) => i18n.t(key, value)
})

Vue.config.productionTip = false



/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
